/*
 * File		:bsp_uart.h
 * This file is usart driver
 * 
 *
 * change Logs:
 * Date		Author		Notes
 * 2009-01-05	guanjingxin	first implementation
 *
 *
 */

#ifndef _BSP_UART_H
#define _BSP_UART_H
/* Header file content */
#include  <cpu_core.h>
#include <fsl_lpuart.h>
#include <fsl_common.h>
/*
*********************************************************************************************************
*                                     EXTERNAL C LANGUAGE LINKAGE
*
* Note(s) : (1) C++ compilers MUST 'extern'ally declare ALL C function prototypes & variable/object
*               declarations for correct C language linkage.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*                                               DEFINES
*********************************************************************************************************
*/
/* The UART to use for debug messages. */
#define BSP_DEBUG_UART_TYPE DEBUG_CONSOLE_DEVICE_TYPE_LPUART
#define BSP_DEBUG_UART_BASEADDR (uint32_t) LPUART1
#define BSP_EBUG_UART_INSTANCE 1U

#define BSP_DEBUG_UART_CLK_FREQ BOARD_DebugConsoleSrcFreq()

#define BSP_UART_IRQ LPUART1_IRQn
#define BSP_UART_IRQ_HANDLER LPUART1_IRQHandler

#ifndef BSP_DEBUG_UART_BAUDRATE
#define BSP_DEBUG_UART_BAUDRATE (115200U)
#endif /* BOARD_DEBUG_UART_BAUDRATE */

#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */

/*******************************************************************************
 * API
 ******************************************************************************/
CPU_INT32U BSP_DebugConsoleSrcFreq(void);

extern void BSP_InitDebugConsole(void);

#if defined(__cplusplus)
}
#endif /* __cplusplus */

#endif /* _BSP_UART_H */
